package com.zhijian.medical.entity.vo.request;

import cn.hutool.json.JSONUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * 试卷评分请求类
 *
 * @author HCG
 * @version 1.0
 * @date 2023-02-07
 */
@Data
@Api(tags = "试卷评分请求类")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AssessmentPaperDoScoreVo implements Serializable {

    private static final long serialVersionUID = -122427393044897554L;

    /**
     * 阅卷人id
     */
    @ApiModelProperty(value = "阅卷人id", hidden = true)
    private Long reviewerId;

    /**
     * 考核id
     */
    @ApiModelProperty("考核id")
    @NotNull(message = "考核id不能为空")
    private Long assessmentId;

    /**
     * 做卷人id
     */
    @ApiModelProperty("做卷人id")
    @NotNull(message = "做卷人不能为空")
    private Long doUserId;

    /**
     * 评分具体数据
     */
    @ApiModelProperty("评分具体数据")
    @NotNull(message = "评分具体数据不能为空")
    @Size(min = 1, message = "评分具体数据不能为空")
    @Valid
    private List<DscScoreVo> scoreList;

    @Data
    @Api(tags = "数字切片部分的评分vo")
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class DscScoreVo implements Serializable {

        private static final long serialVersionUID = 6974243258541567062L;

        /**
         * 病例主键id
         */
        @ApiModelProperty("病例主键id")
        private Long id;

        /**
         * 阅卷人评语的内容
         */
        @ApiModelProperty("阅卷人评语的内容")
        private String comment;

        /**
         * 阅卷人凭据内容的录音文件路径
         */
        @ApiModelProperty("阅卷人凭据内容的录音文件路径")
        private String commentRecordFilePath;

        /**
         * 打的分数
         */
        @ApiModelProperty("打的分数")
        @NotNull(message = "打的分数不能为空")
        private Integer score;

        @Override
        public String toString() {
            return JSONUtil.toJsonStr(this);
        }

    }
}
